﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Model
{
    /// <summary>
    /// 个人基本信息
    /// </summary>
    public class PersonalInformation
    {
        public PersonalInformation() { }

        public PersonalInformation(int id, string name, string nickname, string email, int gender, string password, string phone)
        {
            this.Id = id;
            this.Name = name;
            this.Nickname = nickname;
            this.Gender = gender;
            this.Password = password;
            this.Phone = phone;
            this.Email = email;
        }

        public override bool Equals(object obj)
        {
            PersonalInformation o = (PersonalInformation)obj;
            if (this.Name == o.Name &&
                this.Nickname == o.Nickname &&
                this.Password == o.Password &&
                this.Phone == o.Phone &&
                this.Gender == o.Gender &&
                this.Email == o.Email)
                return true;
            return false;
        }

        #region Basic Getters and Setters
        private int _id;                            // PK

        public int Id
        {
            get { return _id; }
            set { _id = value; }
        }


        private DateTime _registerTime;             // 注册时间

        public DateTime RegisterTime
        {
            get { return _registerTime; }
            set { _registerTime = value; }
        }

        private int _gender;                        // 性别 0 女 1 男

        public int Gender
        {
            get { return _gender; }
            set { _gender = value; }
        }


        private string _phone;                      // 电话

        public string Phone
        {
            get { return _phone; }
            set { _phone = value; }
        }

        private string _email;

        public string Email                         // 邮箱
        {
            get { return _email; }
            set { _email = value; }
        }


        private string _name;                       // 名字

        public string Name
        {
            get { return _name; }
            set { _name = value; }
        }


        private string _password;

        public string Password                      // 密码
        {
            get { return _password; }
            set { _password = value; }
        }


        private string _nickname;                   // 昵称

        public string Nickname
        {
            get { return _nickname; }
            set { _nickname = value; }
        }

        #endregion


    }

    public enum GenderName
    {
        女,
        男
    }

    public enum UserTypeName
    {
        房主,
        客户,
        管理员
    }
}
